UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JmN/JO7MzOCfthCT9KBp30joyWw/5GCeJTP3ubcrJTM='
WHERE
key_id = '83817b510309a7eff5d0c1bc1b633ddd9544e60ecfcf19f8f261ae04730c4112'
AND (
token = 'JmN/JO7MzOCfthCT9KBp30joyWw/5GCeJTP3ubcrJTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)