UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c3KplhBdyl4hZZvQsJUlyRMqonJocuJRtEZ/UAQxzTU='
WHERE
key_id = 'e74dbfe1194c68410f7e5ed957d9df4294ea5737fd8f594b2ca45bf476304376'
AND (
token = 'c3KplhBdyl4hZZvQsJUlyRMqonJocuJRtEZ/UAQxzTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)