UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1mXpZAq4wm4qmhXvu3IP7rclrTovk6muxEpC+EVMGzg='
WHERE
key_id = 'bd41f09f3cdd173d791af29455242eb43328c996bb0d873f315ec2d725e7edce'
AND (
token = '1mXpZAq4wm4qmhXvu3IP7rclrTovk6muxEpC+EVMGzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)