UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'olpPBLGtLAYPy3J1/hET5xTTcco3wP/w9V4OWP80p7Y='
WHERE
key_id = '9e0fd2517bc1d7d1971389b2e102b9fcaf12e74b947ac242215d0944d863c8bc'
AND (
token = 'olpPBLGtLAYPy3J1/hET5xTTcco3wP/w9V4OWP80p7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)