UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9QuontDB7BIf9A9h13Eljm092UO/Jkfi0h4J2w5mMMw='
WHERE
key_id = '157bc21412bf41bb8c31a78bf40cc6c21455010393a98258bc1b9a0b08879fa6'
AND (
token = '9QuontDB7BIf9A9h13Eljm092UO/Jkfi0h4J2w5mMMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)