UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H2Y6C/e+RhD9mICfCQMjPEa5crfl+WyfwCKr15e9gd8='
WHERE
key_id = '449887d9011dca14d3691f4309dc0d796aa01804d36b90a9ac9d8636b9328c87'
AND (
token = 'H2Y6C/e+RhD9mICfCQMjPEa5crfl+WyfwCKr15e9gd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)