UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zlSZgHRzcHUpMOO5J4Vj1OqfRsE3Pc0if/qZGv14UY4='
WHERE
key_id = 'e33ae8ca42426cdabf4af261a2c603c3cf75cd505f3ce2f9a9ed8364c727a7aa'
AND (
token = 'zlSZgHRzcHUpMOO5J4Vj1OqfRsE3Pc0if/qZGv14UY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)