UPDATE
cscart_aprillock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DLhk6Tlop67pwAuhxrzrgdVcKOj3MCpv7sdfLHKrFOc='
WHERE
key_id = 'e358d417b07918e7376205b38dc5fad63cf498fa1fd9a0d0425eeb093da2c5b3'
AND (
token = 'DLhk6Tlop67pwAuhxrzrgdVcKOj3MCpv7sdfLHKrFOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)