UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HeqV0S+F5NhVFWJfcqt7XGbEl3qxZrRSg3EeJEmGfBw='
WHERE
key_id = '6f0ba58e8721fee4de8833d94078d1b0bd19d5bc1e7d3c0e507e5dd15c64d394'
AND (
token = 'HeqV0S+F5NhVFWJfcqt7XGbEl3qxZrRSg3EeJEmGfBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)