UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lugdukCT8phRqaweCuH4MIOZhXWOvzIVZP7TM8TAga0='
WHERE
key_id = 'bf277b377462f208e219ffd0bcdbc3e415db69dc59619995beb13417764f2d99'
AND (
token = 'lugdukCT8phRqaweCuH4MIOZhXWOvzIVZP7TM8TAga0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)