UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PoU+RLTCjAUDlWzExmghBZgT2T49yAfEi5oLjUpfGxY=' 
WHERE 
  key_id = '362af74c44ae114814bfe43f35f857a8db14e6974172ae8d297eec840d49af26' 
  AND (
    token = 'PoU+RLTCjAUDlWzExmghBZgT2T49yAfEi5oLjUpfGxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041