UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'If6uytLIbUDUMJU8FXWYM/VJr5Il0d969vh6vasnnmo='
WHERE
key_id = '634d600401a17f13e1f94d5f39af23d422fb5bb01e96dd813e34f24bf78fb300'
AND (
token = 'If6uytLIbUDUMJU8FXWYM/VJr5Il0d969vh6vasnnmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)