UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/yjcyONtehbXEoUHJk0uBOUFgf9or12Vx7ThkV7GkZQ='
WHERE
key_id = '685e4d7e6fd1c9a3bd5c501f2a9c320fa4d77045740850180c18a0953d336d24'
AND (
token = '/yjcyONtehbXEoUHJk0uBOUFgf9or12Vx7ThkV7GkZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)