UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/59R9c7VEhfdHcmwKgxE+voWZQj8+WKmjyMeVajziPo=' 
WHERE 
  key_id = '75423c598d17755f293d5df1ca856c98cbcadd6164d2bbe3026fd246558d2a76' 
  AND (
    token = '/59R9c7VEhfdHcmwKgxE+voWZQj8+WKmjyMeVajziPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016