UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+9z/Oc1CRGwUvwwZK04COq3UxTWK0LmsBlb2kWXEwWc=' 
WHERE 
  key_id = 'c27033c47296d031741d3bde3157d7fc18dc1c75d9235e5e2ca5d4a312822006' 
  AND (
    token = '+9z/Oc1CRGwUvwwZK04COq3UxTWK0LmsBlb2kWXEwWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039