UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N2oV0GMp3G8OQ6d+CsF/2KVab6Euj9dU9iy6bcF/Ezc='
WHERE
key_id = '45f355ffde1278f0f4f27ead4d05c1ba60bb561e5262920dd39ef209d3199cd1'
AND (
token = 'N2oV0GMp3G8OQ6d+CsF/2KVab6Euj9dU9iy6bcF/Ezc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)