UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q9FG92LSTDj/hKY29+fk8CIUL0EhSrXAmP66Gpuy0jk=' 
WHERE 
  key_id = '70b8466887e04982041723d606666dd7643af725077bea556955e3f8fda66a9c' 
  AND (
    token = 'q9FG92LSTDj/hKY29+fk8CIUL0EhSrXAmP66Gpuy0jk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027