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

Query time 0.00022