UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lJGwh2yGmwJ8jq5yuU+ymcMSRnaqKz6dha0/EmAFuqI=' 
WHERE 
  key_id = '74f95b5fae0f6da8b617e4d1198b8548e4f3d599882825414a981b02177b62d3' 
  AND (
    token = 'lJGwh2yGmwJ8jq5yuU+ymcMSRnaqKz6dha0/EmAFuqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038