UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M4JJPBBJE/8pnw6xBKsbI7YFAU1dV01/RlsSqHd3+aQ='
WHERE
key_id = '969545b1fbb3187bc946a056e428ce7bae1b6db4f39e5a2a07ad14ccaa04483d'
AND (
token = 'M4JJPBBJE/8pnw6xBKsbI7YFAU1dV01/RlsSqHd3+aQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)