UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WFF62zYjbPYqcFryXDoVemKguebWgO6KsDGR6KHHKWA='
WHERE
key_id = '822f5bac73dfbfc78fb094eacaab63372da77152ff4f4415edaef7b00468fd8c'
AND (
token = 'WFF62zYjbPYqcFryXDoVemKguebWgO6KsDGR6KHHKWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)