UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rsfXsSK/5dwIoEHeHHRba1Z94hol35AtNVxKYYSid5k='
WHERE
key_id = '6fdaee90281e9f2c1690c69c0eec2a5d2d601bd6a1587c1ead9f53f27f880b4c'
AND (
token = 'rsfXsSK/5dwIoEHeHHRba1Z94hol35AtNVxKYYSid5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)