UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8oR/QgDKPBYys5I22XSv9lLIs0ZYiciT80b+D7HlS00='
WHERE
key_id = '42b671b3c374505f90099f741de30eb1a7a28d099939b36b6d8f0d46cbc6ab7b'
AND (
token = '8oR/QgDKPBYys5I22XSv9lLIs0ZYiciT80b+D7HlS00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)