UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ns7o8rar9ONZZWxBG+ud2DYDB6T5+gATlAkKTZIgEeU='
WHERE
key_id = '88860eacc44fffdcd609da96a7f630f11c020d1b8bc9269b4931ddbf4c5eda26'
AND (
token = 'ns7o8rar9ONZZWxBG+ud2DYDB6T5+gATlAkKTZIgEeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)