UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CqodrUbzUZV9rd0Q4QMW7Dbzw3IgTVz3zG/HVuWctFA='
WHERE
key_id = '888bc8636dbc45e3457a9a0bdf2d46ab1910ea302c21cfc652a74e187f4a2d34'
AND (
token = 'CqodrUbzUZV9rd0Q4QMW7Dbzw3IgTVz3zG/HVuWctFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)