UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PlNN42hpYLeD+wu3L02vwVL4mE6fGxE6XOG4dovz97g='
WHERE
key_id = 'd94ee2059f52e1495d04e309e8087e679152bfcd6b215ae397a6755fee1abd81'
AND (
token = 'PlNN42hpYLeD+wu3L02vwVL4mE6fGxE6XOG4dovz97g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)