UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TfJ3WZNutmtJb+ra3rGK92OXWC8WTL+VDvvm9ZGPp+Q=' 
WHERE 
  key_id = 'e2328afc93c51a9340a806db403499b56207bca875c18ed1e38f2bc34130bfeb' 
  AND (
    token = 'TfJ3WZNutmtJb+ra3rGK92OXWC8WTL+VDvvm9ZGPp+Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028