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