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

Query time 0.00028