UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'psf1YrsDA2niwCzE03zzVrS9Si/ovRia6bD92TFiZdo='
WHERE
key_id = '2e96f79f3cd70c79a94cf42b18cfc09a67068f7825501e64859d5807c009d7fa'
AND (
token = 'psf1YrsDA2niwCzE03zzVrS9Si/ovRia6bD92TFiZdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)