UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0GEuDUj1H475Nk+o/IZRJk8lJB9j5yXTuKQvmNZJVng=' 
WHERE 
  key_id = '6cb76740824ad9dd47945360aae265b4ba233a78c98bcf3c3b2493207637af00' 
  AND (
    token = '0GEuDUj1H475Nk+o/IZRJk8lJB9j5yXTuKQvmNZJVng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037