UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '70Mlshx8CtHQOD9GrnA9wqs4pdl5dwZWyroOO0jO85g='
WHERE
key_id = '71a5c6b7e45e3052711384591b8eb25fe8aa09df75a0fed27c2e85bdce97e2fb'
AND (
token = '70Mlshx8CtHQOD9GrnA9wqs4pdl5dwZWyroOO0jO85g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)