UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '46cqnXm++gRHYvnnNcaFs39n2cKmTZEpN3J4lhQYD44='
WHERE
key_id = 'a41c37d325ec2810fba12afd2d7e46b373ebd23529152af4b78fb80241136100'
AND (
token = '46cqnXm++gRHYvnnNcaFs39n2cKmTZEpN3J4lhQYD44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)