UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q9CW4yzqLjDe98ICSmXXeqvJHSFLG1SGqLbTAq3E4BU='
WHERE
key_id = 'b5652cb9cb00ebaa1696c5e35ea0dc73664e95800273906c5c3bd7e9958ddeb7'
AND (
token = 'Q9CW4yzqLjDe98ICSmXXeqvJHSFLG1SGqLbTAq3E4BU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)